package com.llb666.shop.items.domain.client;

import com.llb666.shop.items.domain.client.entity.Orders;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author llb666
 */
@Component
@FeignClient(contextId = "orderClient", value = "shop-order")
public interface OrderClient {

    /**
     * 根据用户id和订单id查询订单信息.
     *
     * @param userId  用户id
     * @param orderId 订单id
     * @return 订单
     */
    @GetMapping("myorders/details")
    Orders queryMyOrder(@RequestParam("userId") String userId, @RequestParam("orderId") String orderId);

    /**
     * 更新订单为"已评论".
     *
     * @param orderId 订单id
     */
    @PutMapping("myorders/updateCommentsStatus")
    void updateCommentsStatus(String orderId);

    /**
     * 修改订单状态表的留言时间.
     *
     * @param orderId 订单id
     */
    @PutMapping("myorders/updateOrderStatus")
    void updateOrderStatus(String orderId);

}
